<?php
class shop_htmlControl extends skymvc{
	public $skins="shop/index/";
	public function __construct(){
		parent::__construct();			
	}
	
	public function onInit(){
		$shopid=get_post("shopid","i");
		$shop=M("shop")->selectRow(array("where"=>" status<10 AND shopid=".$shopid));
		$this->smarty->assign("shopskins",$this->skins);
		$this->smarty->assign("shop",$shop);
		if(empty($shop)){
			$this->goall("店铺不存在",1);
		}
		//$word=get_post('word','h');
		$word=get_post('a','h');
		$data=M("shop_html")->selectRow("word='".$word."' AND shopid=".$shopid);
		if(empty($data)){
			$word="index";
		}
		$this->smarty->assign(array(
			"data"=>$data
		));
		$this->smarty->assign("shopskins","shop/".$shop['tpl']);
		
		$this->smarty->display($this->skins."html/".$word.".html");
	}
	public function onDefault(){
		
	}
	
	 
	
	
	
}
?>